{extend name="public:layout" /}
{block name='title'}编辑企业资料{/block}
{block name='head'}
<style>
    body{
        background:#ebebeb;
    }
</style>
{/block}
{block name="body"}
<div class="mcm-user-head">
    <div class="head-left">
        <a href="javascript:history.back(-1)" class="link">
            <span class="iconfont icon-zuoyou1"></span>
        </a>
    </div>
    <div class="head-title">
        企业资料
    </div>
    <div class="head-right">
        <a href="javascript:;" class="link link-btn" onclick="sendError()">
            报错
        </a>
    </div>
</div>
<div style="height:50px;"></div>
<div class="company-binding-box">
    <div class="weui-cells weui-cells_form">
        <div class="weui-cell">
            <div class="weui-cell__hd"><label class="weui-label">企业名称</label></div>
            <div class="weui-cell__bd">
                {$companyInfo.company_name}
            </div>
        </div>
        <div class="weui-cell">
            <div class="weui-cell__hd"><label class="weui-label">所在区域</label></div>
            <div class="weui-cell__bd">
                {$companyInfo.address_text}
            </div>
        </div>
        <div class="weui-cell">
            <div class="weui-cell__hd"><label class="weui-label">所属行业</label></div>
            <div class="weui-cell__bd">
                {$companyInfo.dept_name}
            </div>
        </div>
        <div class="weui-cell">
            <div class="weui-cell__hd"><label class="weui-label">主营项目</label></div>
            <div class="weui-cell__bd">
                {$companyInfo.company_intro}
            </div>
        </div>
        <div class="weui-cell">
            <div class="weui-cell__hd">
                <label class="weui-label">企业地址</label>
            </div>
            <div class="weui-cell__bd">
                {$companyInfo.address_text}{$companyInfo.company_address}
            </div>
        </div>
    </div>
</div>
{/block}
{block name="js"}
<script>
    function sendError() {
        var html="<div class=\"weui-cells\">\n" +
            "  <div class=\"weui-cell\">\n" +
            "    <div class=\"weui-cell__bd\">\n" +
            "      <textarea class=\"weui-textarea\" id='error' type=\"text\" placeholder=\"请以简短的话语输入错误信息以及修改意见\" rows=\"5\"></textarea>\n" +
            "    </div>\n" +
            "  </div>\n" +
            "</div>" ;
        layer.open({
            content: html
            ,btn: '提交'
            ,yes:function () {
                var info=$('#error').val();
                $.post('{:url("companyError")}',{company_id:'{$companyInfo.company_id}',error_msg:info},function (res) {
                    layer.open({
                        content: res.msg
                        ,skin: 'msg'
                        ,time: 2 //2秒后自动关闭
                    });
                    if (res.code){
                        layer.closeAll();
                    }
                })
            }
        });
    }
</script>
{/block}